/**
 * Created by sun on 2016/8/4.
 */
define(function (require) {
    var app = require('/../js/app');
    require('ui-table');

    app.useModule("ui.table");

    var datepicker = require('datepicker');
    app.controller('experience_goldCtrl', ['$scope','$http','$filter' ,function ($scope, $http,$filter) {
        $scope.orderParams = {
            url: "/admin/experiencedGold/list"
        };
        datepicker($scope);
        //全局查询
        $scope.search = function() {
            $scope.ctrlScope.itemsearch.beginDate=$scope.ctrlScope.itemsearch.beginDatex;
            $scope.ctrlScope.itemsearch.endDate=$scope.ctrlScope.itemsearch.endDatex;
            $scope.ctrlScope.itemsearch.beginDate=$filter('date')($scope.ctrlScope.itemsearch.beginDate,'yyyy-MM-dd');
            $scope.ctrlScope.itemsearch.endDate=$filter('date')($scope.ctrlScope.itemsearch.endDate,'yyyy-MM-dd');
            //表格查询参数设置
            $scope.orderParams.ajaxParam=$scope.ctrlScope.itemsearch;
            //表格刷新
            $scope.orderParams.reload();
        };
        //全局查询重置
        $scope.reset=function(){
            $scope.orderParams.ajaxParam={};
            $scope.ctrlScope.itemsearch={};
            $scope.orderParams.reload();
        };
    }]);


});